package com.xxx.car.web.api;

import com.xxx.car.entity.vo.response.RespDict;
import com.xxx.car.service.DictService;
import com.xxx.common.base.vo.APIResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * Created by xuwenjie on 2017/6/22.
 */
@Controller
@RequestMapping("/api/dict")
public class ApiDictController {

    @Autowired
    private DictService dictService;

    @RequestMapping("/list")
    @ResponseBody
    public APIResponse list(@RequestParam String group) {
        List<RespDict> resp = dictService.findByGroup(group);
        return APIResponse.returnSuccess(resp);
    }
}
